Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor already-signed-in check into a decorator #5317

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

quis
Copy link
Member

@quis quis commented Dec 4, 2024

It makes sense for this check-and-redirect code to be a decorator because:

  • it’s checking a similar, generic thing to other decorators like is_platform_admin
  • it’s repeated 3 times and by making it a decorator we can reuse it

quis added 2 commits December 5, 2024 11:34
It makes sense for this check-and-redirect code to be a decorator because:
- it’s checking a similar thing to other decorators like `is_platform_admin`
- it’s repeated in 2 places and by making it a decorator we can reuse it
By removing some code we have snuck the complexity level of this code
within the limit of 10, so it passes `ruff` now
@quis quis force-pushed the redirect-when-logged-in-decorator branch from f63a9c7 to c5cc8f6 Compare December 5, 2024 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants